Skip to content

Crash fix - when cancelling an authentication session #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Prash88
Copy link

@Prash88 Prash88 commented Apr 2, 2025

Steps to repro

In Example app,

Tap sign in, hit continue.
Move the app to the background.
Go to Settings > Safari > Clear History and Website Data.
Go into the app again. A new permission dialog is shown.
Tap Cancel. App crashes.

Recording from example app: https://streamable.com/5m16cx

Reasons for crash

The crash happens because of ASWebAuthenticationSession getting deallocated during or immediately after completion handler
http://ww.openradar.appspot.com/FB12132525

Fix explanation

As suggested, this crash can be mitigated by intentionally retaining the authentication session until after the dismiss animation is complete.

@camden-king
Copy link

Verified the crash described occurs in iOS example app with Okta and that the proposed fix prevents the crash.

@brnnmrls brnnmrls self-requested a review April 16, 2025 14:14
@brnnmrls
Copy link
Collaborator

@Prash88 Do you mind fixing the failing tests, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants